<template>
  <div class="cate">
    <!-- 面包屑-->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>商品管理</el-breadcrumb-item>
      <el-breadcrumb-item>商品分类</el-breadcrumb-item>
    </el-breadcrumb>

    <!--    卡片视图-->
    <el-card class="box-card">
      <el-button type="primary">添加分类</el-button>
      <table-tree :data="cateList" :columns="columns" stripe border :expand-type="false" :selection-type-="false">

      </table-tree>
    </el-card>
  </div>
</template>

<script>
  import {getCateList} from '../../network/home'
  export default {
    name: "Cate",
    data() {
      return {
        queryInfo:{
          type:3,
          pagenum:1,
          pagesize:5
        },
        cateList:[],
        columns: [
          {
            label: '分类名称',
            prop: 'cat_name',
            width: '400px',
          },
        ]
      }
    },
    methods: {
      getCateLists(queryInfo){
        getCateList(queryInfo).then(res=>{
          console.log(res);
          if (res.meta.status !== 200) return this.$message.error(res.meta.msg)
          this.cateList = res.data.result
        })
      }
    },
    created() {
      this.getCateLists(this.queryInfo)
    }
  }
</script>

<style scoped>

</style>
